\(\int \frac {(d+e x+f x^2) (2-x-2 x^2+x^3)}{(4-5 x^2+x^4)^2} \, dx\) [87]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 36, antiderivative size = 82 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {d-2 e+4 f}{12 (2+x)}-\frac {1}{18} (d+e+f) \log (1-x)+\frac {1}{48} (d+2 e+4 f) \log (2-x)+\frac {1}{6} (d-e+f) \log (1+x)-\frac {1}{144} (19 d-26 e+28 f) \log (2+x) \]

[Out]

1/12*(d-2*e+4*f)/(2+x)-1/18*(d+e+f)*ln(1-x)+1/48*(d+2*e+4*f)*ln(2-x)+1/6*(d-e+f)*ln(1+x)-1/144*(19*d-26*e+28*f
)*ln(2+x)

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {1600, 6874} \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {d-2 e+4 f}{12 (x+2)}-\frac {1}{18} \log (1-x) (d+e+f)+\frac {1}{48} \log (2-x) (d+2 e+4 f)+\frac {1}{6} \log (x+1) (d-e+f)-\frac {1}{144} \log (x+2) (19 d-26 e+28 f) \]

[In]

Int[((d + e*x + f*x^2)*(2 - x - 2*x^2 + x^3))/(4 - 5*x^2 + x^4)^2,x]

[Out]

(d - 2*e + 4*f)/(12*(2 + x)) - ((d + e + f)*Log[1 - x])/18 + ((d + 2*e + 4*f)*Log[2 - x])/48 + ((d - e + f)*Lo
g[1 + x])/6 - ((19*d - 26*e + 28*f)*Log[2 + x])/144

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \frac {d+e x+f x^2}{(2+x)^2 \left (2-x-2 x^2+x^3\right )} \, dx \\ & = \int \left (\frac {d+2 e+4 f}{48 (-2+x)}+\frac {-d-e-f}{18 (-1+x)}+\frac {d-e+f}{6 (1+x)}+\frac {-d+2 e-4 f}{12 (2+x)^2}+\frac {-19 d+26 e-28 f}{144 (2+x)}\right ) \, dx \\ & = \frac {d-2 e+4 f}{12 (2+x)}-\frac {1}{18} (d+e+f) \log (1-x)+\frac {1}{48} (d+2 e+4 f) \log (2-x)+\frac {1}{6} (d-e+f) \log (1+x)-\frac {1}{144} (19 d-26 e+28 f) \log (2+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.94 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {1}{144} \left (\frac {12 (d-2 e+4 f)}{2+x}+24 (d-e+f) \log (-1-x)-8 (d+e+f) \log (1-x)+3 (d+2 e+4 f) \log (2-x)+(-19 d+26 e-28 f) \log (2+x)\right ) \]

[In]

Integrate[((d + e*x + f*x^2)*(2 - x - 2*x^2 + x^3))/(4 - 5*x^2 + x^4)^2,x]

[Out]

((12*(d - 2*e + 4*f))/(2 + x) + 24*(d - e + f)*Log[-1 - x] - 8*(d + e + f)*Log[1 - x] + 3*(d + 2*e + 4*f)*Log[
2 - x] + (-19*d + 26*e - 28*f)*Log[2 + x])/144

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.96

method result size
default \(\left (\frac {13 e}{72}-\frac {7 f}{36}-\frac {19 d}{144}\right ) \ln \left (x +2\right )-\frac {-\frac {d}{12}+\frac {e}{6}-\frac {f}{3}}{x +2}+\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}\right ) \ln \left (x +1\right )+\left (-\frac {d}{18}-\frac {e}{18}-\frac {f}{18}\right ) \ln \left (x -1\right )+\left (\frac {d}{48}+\frac {e}{24}+\frac {f}{12}\right ) \ln \left (x -2\right )\) \(79\)
risch \(\frac {d}{12 x +24}-\frac {e}{6 \left (x +2\right )}+\frac {f}{3 x +6}+\frac {13 \ln \left (-x -2\right ) e}{72}-\frac {7 \ln \left (-x -2\right ) f}{36}-\frac {19 \ln \left (-x -2\right ) d}{144}+\frac {\ln \left (x +1\right ) d}{6}-\frac {\ln \left (x +1\right ) e}{6}+\frac {\ln \left (x +1\right ) f}{6}-\frac {\ln \left (x -1\right ) d}{18}-\frac {\ln \left (x -1\right ) e}{18}-\frac {\ln \left (x -1\right ) f}{18}+\frac {\ln \left (2-x \right ) d}{48}+\frac {\ln \left (2-x \right ) e}{24}+\frac {\ln \left (2-x \right ) f}{12}\) \(122\)
norman \(\frac {\left (-\frac {d}{12}+\frac {e}{6}-\frac {f}{3}\right ) x +\left (\frac {d}{12}-\frac {e}{6}+\frac {f}{3}\right ) x^{3}+\left (\frac {e}{3}-\frac {2 f}{3}-\frac {d}{6}\right ) x^{2}-\frac {e}{3}+\frac {2 f}{3}+\frac {d}{6}}{x^{4}-5 x^{2}+4}+\left (-\frac {d}{18}-\frac {e}{18}-\frac {f}{18}\right ) \ln \left (x -1\right )+\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}\right ) \ln \left (x +1\right )+\left (\frac {d}{48}+\frac {e}{24}+\frac {f}{12}\right ) \ln \left (x -2\right )+\left (\frac {13 e}{72}-\frac {7 f}{36}-\frac {19 d}{144}\right ) \ln \left (x +2\right )\) \(125\)
parallelrisch \(\frac {48 f +12 d -24 e +6 \ln \left (x -2\right ) d +12 \ln \left (x -2\right ) e -16 \ln \left (x -1\right ) d -16 \ln \left (x -1\right ) e -56 \ln \left (x +2\right ) f +48 \ln \left (x +1\right ) f +26 \ln \left (x +2\right ) x e +6 \ln \left (x -2\right ) x e -8 \ln \left (x -1\right ) x d -8 \ln \left (x -1\right ) x e +24 \ln \left (x +1\right ) x d -24 \ln \left (x +1\right ) x e -19 \ln \left (x +2\right ) x d -38 \ln \left (x +2\right ) d +12 \ln \left (x -2\right ) x f -8 \ln \left (x -1\right ) x f +24 \ln \left (x +1\right ) x f -28 \ln \left (x +2\right ) x f +52 \ln \left (x +2\right ) e +48 \ln \left (x +1\right ) d -48 \ln \left (x +1\right ) e +3 \ln \left (x -2\right ) x d +24 \ln \left (x -2\right ) f -16 \ln \left (x -1\right ) f}{144 x +288}\) \(198\)

[In]

int((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4)^2,x,method=_RETURNVERBOSE)

[Out]

(13/72*e-7/36*f-19/144*d)*ln(x+2)-(-1/12*d+1/6*e-1/3*f)/(x+2)+(1/6*d-1/6*e+1/6*f)*ln(x+1)+(-1/18*d-1/18*e-1/18
*f)*ln(x-1)+(1/48*d+1/24*e+1/12*f)*ln(x-2)

Fricas [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.41 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {{\left ({\left (19 \, d - 26 \, e + 28 \, f\right )} x + 38 \, d - 52 \, e + 56 \, f\right )} \log \left (x + 2\right ) - 24 \, {\left ({\left (d - e + f\right )} x + 2 \, d - 2 \, e + 2 \, f\right )} \log \left (x + 1\right ) + 8 \, {\left ({\left (d + e + f\right )} x + 2 \, d + 2 \, e + 2 \, f\right )} \log \left (x - 1\right ) - 3 \, {\left ({\left (d + 2 \, e + 4 \, f\right )} x + 2 \, d + 4 \, e + 8 \, f\right )} \log \left (x - 2\right ) - 12 \, d + 24 \, e - 48 \, f}{144 \, {\left (x + 2\right )}} \]

[In]

integrate((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4)^2,x, algorithm="fricas")

[Out]

-1/144*(((19*d - 26*e + 28*f)*x + 38*d - 52*e + 56*f)*log(x + 2) - 24*((d - e + f)*x + 2*d - 2*e + 2*f)*log(x
+ 1) + 8*((d + e + f)*x + 2*d + 2*e + 2*f)*log(x - 1) - 3*((d + 2*e + 4*f)*x + 2*d + 4*e + 8*f)*log(x - 2) - 1
2*d + 24*e - 48*f)/(x + 2)

Sympy [F(-1)]

Timed out. \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\text {Timed out} \]

[In]

integrate((f*x**2+e*x+d)*(x**3-2*x**2-x+2)/(x**4-5*x**2+4)**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 68, normalized size of antiderivative = 0.83 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {1}{144} \, {\left (19 \, d - 26 \, e + 28 \, f\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f\right )} \log \left (x + 1\right ) - \frac {1}{18} \, {\left (d + e + f\right )} \log \left (x - 1\right ) + \frac {1}{48} \, {\left (d + 2 \, e + 4 \, f\right )} \log \left (x - 2\right ) + \frac {d - 2 \, e + 4 \, f}{12 \, {\left (x + 2\right )}} \]

[In]

integrate((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4)^2,x, algorithm="maxima")

[Out]

-1/144*(19*d - 26*e + 28*f)*log(x + 2) + 1/6*(d - e + f)*log(x + 1) - 1/18*(d + e + f)*log(x - 1) + 1/48*(d +
2*e + 4*f)*log(x - 2) + 1/12*(d - 2*e + 4*f)/(x + 2)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.88 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=-\frac {1}{144} \, {\left (19 \, d - 26 \, e + 28 \, f\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{6} \, {\left (d - e + f\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{18} \, {\left (d + e + f\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{48} \, {\left (d + 2 \, e + 4 \, f\right )} \log \left ({\left | x - 2 \right |}\right ) + \frac {d - 2 \, e + 4 \, f}{12 \, {\left (x + 2\right )}} \]

[In]

integrate((f*x^2+e*x+d)*(x^3-2*x^2-x+2)/(x^4-5*x^2+4)^2,x, algorithm="giac")

[Out]

-1/144*(19*d - 26*e + 28*f)*log(abs(x + 2)) + 1/6*(d - e + f)*log(abs(x + 1)) - 1/18*(d + e + f)*log(abs(x - 1
)) + 1/48*(d + 2*e + 4*f)*log(abs(x - 2)) + 1/12*(d - 2*e + 4*f)/(x + 2)

Mupad [B] (verification not implemented)

Time = 7.90 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.96 \[ \int \frac {\left (d+e x+f x^2\right ) \left (2-x-2 x^2+x^3\right )}{\left (4-5 x^2+x^4\right )^2} \, dx=\frac {\frac {d}{12}-\frac {e}{6}+\frac {f}{3}}{x+2}+\ln \left (x+1\right )\,\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}\right )-\ln \left (x-1\right )\,\left (\frac {d}{18}+\frac {e}{18}+\frac {f}{18}\right )+\ln \left (x-2\right )\,\left (\frac {d}{48}+\frac {e}{24}+\frac {f}{12}\right )-\ln \left (x+2\right )\,\left (\frac {19\,d}{144}-\frac {13\,e}{72}+\frac {7\,f}{36}\right ) \]

[In]

int(-((d + e*x + f*x^2)*(x + 2*x^2 - x^3 - 2))/(x^4 - 5*x^2 + 4)^2,x)

[Out]

(d/12 - e/6 + f/3)/(x + 2) + log(x + 1)*(d/6 - e/6 + f/6) - log(x - 1)*(d/18 + e/18 + f/18) + log(x - 2)*(d/48
 + e/24 + f/12) - log(x + 2)*((19*d)/144 - (13*e)/72 + (7*f)/36)